package com.hanfengyi.feign;

import com.hanfengyi.feign.fallback.CourseFeignFallbackFactory;
import com.hanfengyi.hrm.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "redis-server",fallbackFactory = CourseFeignFallbackFactory.class)
public interface RedisFeignClient {
    @PostMapping("/redis/set")
    AjaxResult set(@RequestParam("key") String key, @RequestParam("value")String value);

    @GetMapping("/redis/get/{key}")
    AjaxResult get(@PathVariable("key") String key);

    @PostMapping("/redis/setex")
    AjaxResult setex(@RequestParam("key") String key, @RequestParam("seconds") int seconds,@RequestParam("value")String value);
}
